stack = []
top = -1

# 进栈
def inStack(name):
    global top
    stack.append(name)
    top+=1

# 判空
def isEmpty():
    if top == -1: # 空
        return True
    else:  # 不空
        return False

# 取栈顶
def getTop():
    global top
    if isEmpty():
        return False
    else:
        return stack[top]


# 出栈
def outStack():
    global top
    if isEmpty():
        return False
    else:
        del stack[top]
        top-=1


if __name__ == '__main__':
    n = int(input())
    for i in range(n):
        op = input().split()
        if op[0] == 'in':
            inStack(op[1])
        elif op[0] == 'out':
            while getTop() != op[1]:
                outStack()
            outStack()

    if top != -1:
        print(getTop())
    else:
        print("Empty")
